Make by Kate Hartman
Author:Kate Hartman
Language: eng
Format: epub
Tags: COMPUTERS / Hardware / General
ISBN: 9781449336509
Publisher: Maker Media, Inc
Published: 2014-08-11T16:00:00+00:00
map(lightSensorValue, 25, 940, 0, 255)
Figure 7-14. Mapping a value from 25–940 to 0–255
If you are working with a LilyPad light sensor as your input and using the mapped value to control an LED on the analog output pin, you would have an LED that brightens and dims in a way that mimics the conditions of the room. If you wanted to inverse the relationship so that the LED gets brighter as the room gets darker, you can simply flip the to values, as illustrated in Figure 7-15:
map(lightSensorValue, 25, 940, 255, 0)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Circuits | Digital Design |
Electric Machinery & Motors | Electronics |
Fiber Optics | Networks |
Superconductivity |
Whiskies Galore by Ian Buxton(41509)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32876)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32558)
Craft Beer for the Homebrewer by Michael Agnew(17917)
Turbulence by E. J. Noyes(7682)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7120)
Kaplan MCAT General Chemistry Review by Kaplan(6568)
The Thirst by Nesbo Jo(6421)
Bad Blood by John Carreyrou(6260)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6216)
Learning SQL by Alan Beaulieu(6012)
Weapons of Math Destruction by Cathy O'Neil(5805)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5626)
Digital Minimalism by Cal Newport;(5355)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5166)
iGen by Jean M. Twenge(5143)
Secrets of Antigravity Propulsion: Tesla, UFOs, and Classified Aerospace Technology by Ph.D. Paul A. Laviolette(4907)
Design of Trajectory Optimization Approach for Space Maneuver Vehicle Skip Entry Problems by Runqi Chai & Al Savvaris & Antonios Tsourdos & Senchun Chai(4833)
Electronic Devices & Circuits by Jacob Millman & Christos C. Halkias(4728)
